package com.gxs.tga.poc.domain;

import java.io.Serializable;

import javax.persistence.*;

import org.codehaus.jackson.annotate.JsonIgnore;

import java.util.List;


/**
 * The persistent class for the TGA_COMPANY database table.
 * 
 */
@Entity
@Table(name="TGA_COMPANY")
@NamedQuery(name="TgaCompany.findAll", query="SELECT t FROM TgaCompany t")
public class TgaCompany implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="COMP_ID", unique=true, nullable=false, length=100)
	private String compId;

	@Column(name="COMP_NAME", nullable=false, length=200)
	private String compName;

	@Column(name="COUNTRY_NAME", nullable=false, length=100)
	private String countryName;

	@Column(name="DUNS_NUMBER", length=36)
	private String dunsNumber;

	@Column(name="INDUSTRY_TYPE", nullable=false, length=100)
	private String industryType;

	@Column(name="WEBSITE_URL", length=400)
	private String websiteUrl;

	//bi-directional many-to-one association to TgaSolution
	@OneToMany(mappedBy="tgaCompany")
	private List<TgaSolution> tgaSolutions;

	public TgaCompany() {
	}

	public String getCompId() {
		return this.compId;
	}

	public void setCompId(String compId) {
		this.compId = compId;
	}

	public String getCompName() {
		return this.compName;
	}

	public void setCompName(String compName) {
		this.compName = compName;
	}

	public String getCountryName() {
		return this.countryName;
	}

	public void setCountryName(String countryName) {
		this.countryName = countryName;
	}

	public String getDunsNumber() {
		return this.dunsNumber;
	}

	public void setDunsNumber(String dunsNumber) {
		this.dunsNumber = dunsNumber;
	}

	public String getIndustryType() {
		return this.industryType;
	}

	public void setIndustryType(String industryType) {
		this.industryType = industryType;
	}

	public String getWebsiteUrl() {
		return this.websiteUrl;
	}

	public void setWebsiteUrl(String websiteUrl) {
		this.websiteUrl = websiteUrl;
	}

	@JsonIgnore
	public List<TgaSolution> getTgaSolutions() {
		return this.tgaSolutions;
	}

	@JsonIgnore
	public void setTgaSolutions(List<TgaSolution> tgaSolutions) {
		this.tgaSolutions = tgaSolutions;
	}

	public TgaSolution addTgaSolution(TgaSolution tgaSolution) {
		getTgaSolutions().add(tgaSolution);
		tgaSolution.setTgaCompany(this);

		return tgaSolution;
	}

	public TgaSolution removeTgaSolution(TgaSolution tgaSolution) {
		getTgaSolutions().remove(tgaSolution);
		tgaSolution.setTgaCompany(null);

		return tgaSolution;
	}

}